#pragma once
#include "PrimitiveSceneProxy.h"
#include "Runtime/Logic/Resource/StaticMesh.h"

namespace Alice
{
    class StaticMeshComponent;
    class FMeshBatch;
    class StaticMeshSectionInfo
    {
    public:
        class MaterialInterface* mMaterial;
    };
    class StaticMeshLODInfo
    {
    public:
        std::vector<StaticMeshSectionInfo*> mSections;
    };
    class StaticMeshSceneProxy : public PrimitiveSceneProxy
    {
    public:
        class LODInfo
        {
        public:
            struct SectionInfo
            {
                SectionInfo()
                    :mMaterial(nullptr)
                {
                    
                }
                class MaterialInterface* mMaterial;
            };
            std::vector<SectionInfo*> mSectionInfos;
        };
        StaticMeshResource*mStaticMeshResource;
        std::vector<LODInfo*> mLODInfos;
        const StaticMesh* mStaticMesh;
        StaticMeshSceneProxy(StaticMeshComponent*inStaticMeshComponent);
        /** Gets the number of mesh batches required to represent the proxy, aside from section needs. */
        virtual int32 GetNumMeshBatches() const
        {
            return 1;
        }
        virtual void DrawStaticElements(FStaticPrimitiveDrawInterface* PDI) override;
        virtual bool GetMeshElement(FMeshBatch& OutMeshBatch) const;
        uint32 SetMeshElementGeometrySource(
            int32 LODIndex,
            int32 ElementIndex,
            bool bWireframe,
            bool bUseInversedIndices,
            bool bAllowPreCulledIndices,
            const VertexFactory* inVertexFactory,
            FMeshBatch& inOutMesh) const;
        virtual SIZE_T GetTypeHash() const override;
    };
}
